<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center frenchCool_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub frenchCool_fd0_0'>
          <view class='flex flex-wrap align-center frenchCool_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  frenchCool_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='frenchCool_fd0_0_c1_c0'>{{title}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-end frenchCool_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view class="flex benben-position-layout flex flex-wrap align-center myActivities_flex_1"
        :style="{top:(80+StatusBarRpx)+'rpx', }">
        <view>
          <benben-flex-tabs class-name='myActivities_benbenTabsfd1_0' v-model="cateId" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='false' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:702rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center flex ">
                  <view style="text-align: center;"
                    :class="{ 'checkTitlefd1_0': cateId == item.aid, 'flex justify-center flex-wrap align-center myActivities_titlefd1_0_c3': true }"
                    v-for="(item,index) in cateList" :key="index" @tap="chooseCate(item)"
                    :id="`benben_tabsfd1_0-title-item-${item.aid}`">
                    <image v-if="item.img" class="imgsbsb" :src="item.img" mode="aspectFill"></image>
                    <view>{{item.fenleimingcheng}}</view>

                  </view>

                </view>
                <!-- <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line myActivities_linefd1_0">
                </view> -->
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>

      </view>
      <view :style="{height: 88+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout frenchCool_flex_1">
        <template v-for='(item,key0) in activityList'>
          <view class='flex flex-wrap align-stretch frenchCool_fd1_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/pages/shouye/rticleDetails/rticleDetails?id=${item.aid}`" :key='key0'>
            <image class='frenchCool_fd1_0_c0' mode="aspectFill" :src='item.img'></image>
            <view class='flex flex-direction flex-wrap align-stretch justify-between'>
              <text class='frenchCool_fd1_0_c1_c0'>{{item.title}}</text>
              <view class='flex flex-wrap align-center'>
                <text class='frenchCool_fd1_0_c1_c1_c0'>{{$t('发布时间')}}：</text>
                <text class='frenchCool_fd1_0_c1_c1_c0'>{{item.create_time}}</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "activityList": [],
        title: '',
        cateId: 0,
        cateList: []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {

      this.title = options.name
      this.getCate()
      this.getActivityFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.getActivityFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      chooseCate(item) {
        this.cateId = item.aid
        this.getActivityFunc()
      },
      getCate() {
        this.$api.post(global.apiUrls.post67106e3f893f9, {
          type: 3
        }).then(res => {
          if (res.data.code == 1) {
            this.cateList = res.data.data
            this.cateList.unshift({
              aid: 0,
              fenleileixing: '0',
              fenleimingcheng: global.i18n.t('全部')
            })
            this.cateId = this.cateList[0].aid
            console.log('cateList', this.cateList)
          }
        })
      },
      //获取活动列表
      getActivityFunc() {
        this.minixPagingListsApi = global.apiUrls.post65b88add4f5a9;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          cateid: this.cateId
        }
        this.listData = [];
        this.activityList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .imgsbsb {
    width: 80rpx;
    height: 80rpx;
    display: block;
    margin: 0 auto;
    border-radius: 16rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #912F22 !important;
  }

  .myActivities_linefd1_0 {
    background: rgba(145, 47, 34, 1);
    width: 16rpx;
    height: 16rpx;
    top: 72rpx;
    background-size: 100% auto !important;
    border-radius: 100rpx;
  }

  .myActivities_flex_1 {
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 200rpx;
    overflow: hidden;
    z-index: 10;
    top: 100rpx;
    padding: 0 16rpx;
    margin: 0 auto;
    background-size: 100% auto;
  }

  .myActivities_titlefd1_0_c3 {
    // margin: 0rpx 24rpx 0rpx 0rpx;
  }

  ::v-deep .myActivities_benbenTabsfd1_0 {
    width: 750rpx;
    height: 200rpx;
    white-space: nowrap;
    text-align: center;
    // margin: 0 auto;
    font-size: 28rpx;
    font-weight: 400;
    color: #666666;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(247, 243, 237, 1);
    background-size: 100% auto;
  }

  .frenchCool_flex_0 {
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .frenchCool_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .frenchCool_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .frenchCool_fd0_0_c0 {
    width: 120rpx;
  }

  .frenchCool_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .frenchCool_flex_1 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .frenchCool_fd1_0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 36rpx;
  }

  .frenchCool_fd1_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
    width: 396rpx;
  }

  .frenchCool_fd1_0_c0 {
    width: 200rpx;
    height: 200rpx;
    border-radius: 24rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .frenchCool_fd1_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }
</style>
